﻿<UserControl x:Class="SensorWpf.SensorDebug"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    >
    <Grid>
        <StackPanel>
            <Button x:Name="butInit" Content="init sensors" Click="butInit_Click" Margin="10,5,10,10"/>
            <StackPanel x:Name="stkAccelerometer">
                <DockPanel x:Name="stkX">
                    <TextBlock Text="{Binding AccelerationX}" DockPanel.Dock="Right" MinWidth="40"/>
                    <TextBlock Text=" X = " DockPanel.Dock="Right"/>
                    <ProgressBar Minimum="{Binding AccelerationXMinimum,Mode=OneWay}" Maximum="{Binding AccelerationXMaximum,Mode=OneWay}" Value="{Binding AccelerationX,Mode=OneWay}" MinWidth="10"/>
                </DockPanel>
                <DockPanel x:Name="stkY">
                    <TextBlock Text="{Binding AccelerationY}" DockPanel.Dock="Right" MinWidth="40"/>
                    <TextBlock Text=" Y = " DockPanel.Dock="Right" />
                    <ProgressBar Minimum="{Binding AccelerationYMinimum,Mode=OneWay}" Maximum="{Binding AccelerationYMaximum,Mode=OneWay}" Value="{Binding AccelerationY,Mode=OneWay}"  MinWidth="10"/>
                </DockPanel>
                <DockPanel x:Name="stkZ">
                    <TextBlock Text="{Binding AccelerationZ}" DockPanel.Dock="Right" MinWidth="40"/>
                    <TextBlock Text=" Z = " DockPanel.Dock="Right"/>
                    <ProgressBar Minimum="{Binding AccelerationZMinimum,Mode=OneWay}" Maximum="{Binding AccelerationZMaximum,Mode=OneWay}" Value="{Binding AccelerationZ,Mode=OneWay}"  MinWidth="10"/>
                </DockPanel>

                <Grid x:Name="grdAmbientLight" Margin="0,5,0,0">
                    <ProgressBar Minimum="0" Maximum="{Binding LuxMaximum,Mode=OneWay}" Value="{Binding Lux,Mode=OneWay}"  MinWidth="10"/>
                    <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="1,1,-1,-1">
                        <TextBlock Text="Lux = " Foreground="White"/>
                        <TextBlock Text="{Binding Lux}" Foreground="White"/>
                    </StackPanel>
                    <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
                        <TextBlock Text="Lux = "/>
                        <TextBlock Text="{Binding Lux}"/>
                    </StackPanel>
                </Grid>

                <ItemsControl x:Name="iscSwitchRank">
                    <ItemsControl.ItemTemplate>
                        <DataTemplate>
                            <StackPanel>
                                <ItemsControl ItemsSource="{Binding SwitchStates}" >
                                    <ItemsControl.ItemTemplate>
                                        <DataTemplate>
                                            <StackPanel Orientation="Horizontal">
                                                <TextBlock Text="{Binding Name}"/>
                                                <TextBlock Text="{Binding State}"/>
                                            </StackPanel>
                                        </DataTemplate>
                                    </ItemsControl.ItemTemplate>
                                </ItemsControl>
                            </StackPanel>
                        </DataTemplate>
                    </ItemsControl.ItemTemplate>
                </ItemsControl>

            </StackPanel>
            <Button x:Name="butRecalibrate" Content="Reset calibration" Click="butRecalibrate_Click" Margin="10,10,10,0"/>
        </StackPanel>
    </Grid>
</UserControl>
